/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package refactoring;

/**
 *
 * @author kvsevolo
 */
public class Refactoring {
    //static final String path = "C:\\SDK\\assets\\common_new_gen\\";
    static final String path = "C:\\Users\\Vsevolod Kazakov\\hymns2\\release_1_91_1\\assets\\common_new_gen\\";
    static final String MELODY_FOLDER = "C:\\Users\\Vsevolod Kazakov\\hymns2\\";
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        TableManager inst = TableManager.getInstance();
        inst.tableManagerInit();
        for (int i = 1; i < 801; i++) {
        //for (int i = 1; i < 50; i++) {
            System.out.println("i = " + i);
            String appendString = "";
            if (i < 100) {
                appendString += "0";
                if (i < 10) {
                    appendString += "0";
                }
            }
                        
            SingleHymn hymn = SingleHymn.CreateSingleHymn();
            String fileName = path + appendString + Integer.toString(i) + ".txt";
            hymn.initHymn(fileName);
            //hymn.downLoadMidi(false, MELODY_FOLDER);
            //hymn.downLoadMidi(true, MELODY_FOLDER);
            inst.insertSingleHymn(hymn);
            inst.addToSubCategoryTable(hymn);
        }
        inst.saveFirstChars();
        inst.saveMainThemeCategory();
        inst.saveSubThemeCategory();
        inst.close();
        inst = null;
        System.out.println("=========");
        System.out.println("Finished!");
        System.out.println("=========");
    }
    
}
